﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://www.codeplex.com/EmlenMud
using System;
using System.Runtime.Serialization;
using System.ComponentModel;

namespace BrainTechLLC
{
    [Serializable]
#if NO_SILVERLIGHT
    [Browsable(true)]
    [TypeConverter(typeof(ExpandableObjectConverter))]
#endif
    public class LocationFloat : Vector4BaseFloat, ILocationFloat
    {
        public bool SameLocation(ILocationFloat other) { return X == other.X && Y == other.Y && Z == other.Z && W == other.W; }
        public bool SameLocationInt(ILocationFloat other) { return (int)X == (int)other.X && (int)Y == (int)other.Y && (int)Z == (int)other.Z && (int)W == (int)other.W; }
        public override string ToString() { return SummaryText; }
        public ILocationFloat LocationVector { get { return this; } }
        public bool NoLocation { get { return (X == float.MinValue); } }
        public LocationFloat(LocationFloat location) : base(location) { }
        public LocationFloat(Vector4BaseFloat location) : base(location) { }
        public LocationFloat(float x, float y, float z, float w) : base(x, y, z, w) { }
        public LocationFloat(float x, float y, float z) : base(x, y, z) { }
        public LocationFloat() : base() { X = float.MinValue; }
        public string SummaryText { get { return "X:" + X.ToString() + ", Y: " + Y.ToString() + ", Z: " + Z.ToString(); } }
    }
}
